import QtQuick 2.0
import Qt.labs.settings 1.1

Item {
    id: root
    anchors.fill: parent

    Rectangle {
        id: rect
        width: 100
        height: 100
        color: setting.color

        Settings {
            id: setting
            // 自动记忆color属性
            property var color: "#000000"

            // category: "backup"
            // property var colorBP: backup.color
        }

        MouseArea {
            anchors.fill: parent
            onClicked: {
                setting.color = Qt.hsla(Math.random(), 0.5, 0.5, 1.0);
            }
        }
    }
}
